﻿/// <summary>
/// 手机验证码
/// </summary>
public class Sms
{
    private static string appid = "94194";

    private static string signature = "4a179de0a53cfb2a16e9e35ee212f72a";

    /// <summary>
    /// 发送
    /// </summary>
    /// <param name="phone"></param>
    /// <param name="code"></param>
    /// <returns></returns>
    public static async Task<bool> PhoneCode(string phone, string code)
    {
        try
        {
            var res = await Http.Post<dynamic>("https://api-v4.mysubmail.com/sms/xsend", new
            {
                appid,
                signature,
                to = phone,
                project = "4IemD4",
                vars = new { code }
            });


            return res.status == "success";
        }
        catch (Exception)
        {
            return false;
        }
    }

    
}

